Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Converting Points from Cartesian to Polar or Spherical Form

QuickDraw 3D provides routines that you can use to convert two-dimensional points from Cartesian form ( x y ) to polar form ( r , ), and vice versa. QuickDraw 3D also provides routines that you can use to convert three-dimensional points from Cartesian form ( x y z ) to spherical form (, , ), and vice versa.

Q3Point2D_ToPolar

You can use the Q3Point2D_ToPolar function to convert a two-dimensional point from Cartesian form to polar form.

TQ3PolarPoint *Q3Point2D_ToPolar (
                     const TQ3Point2D *point2D,
                     TQ3PolarPoint *result);
point2D
A two-dimensional point.
result
On exit, a polar point.

DESCRIPTION

The Q3Point2D_ToPolar function returns, as its function result and in the result parameter, a polar point that is the same point as the two-dimensional point specified by the point2D parameter.

Q3PolarPoint_ToPoint2D

You can use the Q3PolarPoint_ToPoint2D function to convert a polar point to Cartesian form.

TQ3Point2D *Q3PolarPoint_ToPoint2D (
                     const TQ3PolarPoint *polarPoint,
                     TQ3Point2D *result);
polarPoint
A polar point.
result
On exit, a two-dimensional point.

DESCRIPTION

The Q3PolarPoint_ToPoint2D function returns, as its function result and in the result parameter, the two-dimensional point that is the same point as the polar point specified by the polarPoint parameter.

Q3Point3D_ToSpherical

You can use the Q3Point3D_ToSpherical function to convert a three-dimensional point from Cartesian form to spherical form.

TQ3SphericalPoint *Q3Point3D_ToSpherical (
                     const TQ3Point3D *point3D,
                     TQ3SphericalPoint *result);
point3D
A three-dimensional point.
result
On exit, a spherical point.

DESCRIPTION

The Q3Point3D_ToSpherical function returns, as its function result and in the result parameter, a spherical point that is the same point as the three-dimensional point specified by the point3D parameter.

Q3SphericalPoint_ToPoint3D

You can use the Q3SphericalPoint_ToPoint3D function to convert a spherical point to Cartesian form.

TQ3Point3D *Q3SphericalPoint_ToPoint3D (
                     const TQ3SphericalPoint *sphericalPoint,
                     TQ3Point3D *result);
sphericalPoint
A spherical point.
result
On exit, a three-dimensional point.

DESCRIPTION

The Q3SphericalPoint_ToPoint3D function returns, as its function result and in the result parameter, the three-dimensional point that is the same point as the spherical point specified by the sphericalPoint parameter.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |